#!/usr/bin/env python3
# -*- Coding:UTF-8 -*-
#  14:46


import unittest

from tools.session_tool import SessionTool


class SetTear(unittest.TestCase):

    @classmethod
    def setUpClass(cls) -> None:
        #创建会话对象，调用对应的类
        SessionTool.get_session()       #创建Session会话（单例）

    @classmethod
    def tearDownClass(cls) -> None:
        SessionTool.close_session()


class SetTearSub(SetTear):
    @classmethod
    def setUpClass(cls) -> None:
        super().setUpClass()
        SessionTool.get_session().cookies.set(name="username",value="admin")
        SessionTool.get_session().cookies.set(name="password",value="Milor123")

    @classmethod
    def tearDownClass(cls) -> None:
        super().tearDownClass()
        SessionTool.get_session().cookies.clear()



